@using Peninsula.Web.Models.ViewModels

@{
    object messages = TempData["Messages"];
    if (messages != null)
    {
        List<NotifyModel> notifyEntries = messages as List<NotifyModel>;
        if (notifyEntries != null)
        {
            foreach (var notifyEntry in notifyEntries)
            {
                string notifyEntryCssClass;
                switch (notifyEntry.Type)
                {
                    case NotifyType.Success:
                        notifyEntryCssClass = "alert-success";
                        break;
                    case NotifyType.Information:
                        notifyEntryCssClass = "alert-info";
                        break;
                    case NotifyType.Warning:
                        notifyEntryCssClass = "alert-warning";
                        break;
                    case NotifyType.Error:
                        notifyEntryCssClass = "alert-danger";
                        break;
                    default:
                        notifyEntryCssClass = "alert-info";
                        break;
                }

                <div class="alert @notifyEntryCssClass">
                    @notifyEntry.Message
                </div>
            }
        }
    }
}